﻿@model sgp.Models.Comunidade

@{
    ViewBag.Title = "Create";
}



<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script>
    jQuery(function ($) {
        $(".cep").mask("99.999-999");
        $(".cnpj").mask("99.999.999/9999-99");
        $(".telefone").mask("(99) 9999-9999");


    });
</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend><b>Cadastrar Comunidade</b></legend>
        
        <table border="0" width="35%" cellpadding="5">
        
        <tr>
            <td>
                <div>
                    Nome:
                </div>
                <div>
                    @Html.TextBoxFor(model => model.Nome, new { @class = "textmaior" })
                    @Html.ValidationMessageFor(model => model.Nome)
                </div>
            </td>
            <td>
                <div>
                     CNPJ:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Cnpj, new { @class = "cnpj" })
                    @Html.ValidationMessageFor(model => model.Cnpj)
                </div>
            </td>
        </tr>    
        <tr>
            <td>
                <div>
                    Endereço:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Rua, new { @class = "textmaior" })
                    @Html.ValidationMessageFor(model => model.Endereco.Rua)
                </div>
            </td>

            <td>
                <div>
                    Nº:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Numero, new { @class = "textpeq" })
                    @Html.ValidationMessageFor(model => model.Endereco.Numero)
                </div>
            </td>
        </tr>
            <tr>
            <td>
                <div>
                    Complemento:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Complemento, new { @class = "textmaior" })
                    @Html.ValidationMessageFor(model => model.Endereco.Complemento)
                </div>
            </td>
            <td>
                
                <div>
                    CEP:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Cep, new { @class = "cep" })
                    @Html.ValidationMessageFor(model => model.Endereco.Cep)
                </div>

            </td>
        </tr>
        </table>
        <table border="0" width="54%" cellpadding="5">
        <tr>
            <td>
                <div>
                    Bairro:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Bairro, new { @class = "textmed" })
                    @Html.ValidationMessageFor(model => model.Endereco.Bairro)
                </div>
            </td>
            <td>        
                <div>
                    Cidade:
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Endereco.Cidade, new { @class = "textmed" })
                @Html.ValidationMessageFor(model => model.Endereco.Cidade)
            </div>
            </td>
            <td>        
                <div>
                    UF:
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Endereco.Estado, new { @class = "textepeq" })
                    @Html.ValidationMessageFor(model => model.Endereco.Estado)
                </div>
            </td>            
        </tr>
        </table>
        <table border="0" width="25%" cellpadding="5">
        <tr>
             <td>
                <div>
                    Contato
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Contato, new { @class = "texmed"})
                    @Html.ValidationMessageFor(model => model.Contato)
                
                </div>
            </td>

               <td>
                <div>
                    Telefone
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Telefone, new { @class = "telefone"})
                    @Html.ValidationMessageFor(model => model.Telefone)
                
                </div>
            </td>

    </tr>
              
         <tr>
            <td>
                <div class="editor-field">
                    <br /> Paroquia <br />
                     @Html.DropDownListFor(model => model.Paroquia.Id, new SelectList(ViewBag.Paroquias, "Id", "Nome"), "Escolha a Paroquia")
                 </div>
            </td>
         </tr>         
        </table>
        <table border="0" width="10%" cellpadding="3">
            <tr>
                <th>
                    <input class="btn btn-success btn-small" type="submit" value="Salvar" />
                </th>
            <th>
                    <a class="btn btn-inverse btn-small" href="/Comunidade/Index" data-original-title="">Voltar</a>
                </th>
            </tr>
        </table>
        
    </fieldset>
}


